
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>报修详情</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta name="viewport" content="width=device-width, user-scalable=no">
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta name=”apple-mobile-web-app-status-bar-style” content=”default” />
	<meta name=”apple-mobile-web-app-status-bar-style” content=”black” />
	<meta name=”apple-mobile-web-app-status-bar-style” content=”black-translucent” />
	<meta content="telephone=no" name="format-detection">
	<meta content="email=no" name="format-detection">
	<meta name="format-detection" content="telephone=no"/>
	<link rel="stylesheet" href="/mobile/css/weui.min.css" />
	<link rel="stylesheet" href="/mobile/css/jquery-weui.css" />
	<link rel="stylesheet" href="/mobile/css/wbNew.css" />
	<link href="/mobile/css/weChat.css" rel="stylesheet" />
	<script type="text/javascript" src="/mobile/js/fontSize.js"></script>
	<script type="text/javascript" src="/mobile/js/jquery-2.1.4.min.js"></script>
	<script src="/mobile/js/jquery-weui.js"></script>
	<script type="text/javascript" src="/mobile/js/common.js"></script>
	<script type="text/javascript" src="/mobile/js/ajaxfileupload.js"></script>
</head>
<body>
<div class="main-content75 wb-service-bg1" id="service-records">
	<div class="main-nei-ctn">
		<div class="prebtn-icon" onclick="history.back()"><i class="cyfont">&#xe6d5;</i>上一页</div>
		<div class="main-nei-block">
			<div class="main-nei-tit"><span>基本信息</span></div>
			<div class="service-records-list">
				<#if wbRepair.repairType=="1">
					<div class="div-line-input">
						<label>设备名称：</label>
						<input readonly="readonly" type="text" value="${wbRepair.deviceName}">
					</div>
					<div class="div-line-input">
						<label>报修人：</label>
						<input readonly="readonly" type="text" value="${wbRepairUser.name!'无'}">
					</div>
					<div class="div-line-input">
						<label>联系方式：</label>
						<input readonly="readonly" type="text" value="${wbRepairUser.phone!'无'}">
					</div>
				</#if>
				<#if wbRepair.repairType=="2">
					<div class="div-line-input">
						<label>设备名称：</label>
						<input readonly="readonly" type="text" value="${wbDevices.name!'无'}">
					</div>
					<div class="div-line-input">
						<label>设备编号：</label>
						<input readonly="readonly" type="text" value="${wbDevices.num!'无'}">
					</div>
					<div class="div-line-input">
						<label>设备型号：</label>
						<input readonly="readonly" type="text" value="${wbDevices.deviceModel!'无'}">
					</div>
					<div class="div-line-input">
						<label>报修位置：</label>
						<input readonly="readonly" type="text" value="${wbDevices.roomName!'无'}">
					</div>
					<div class="div-line-input">
						<label>服务商电话：</label>
						<input readonly="readonly" type="text" value="${wbDevices.servicerMobile!'无'}">
					</div>
					<div class="div-line-input">
						<label>报修人：</label>
						<input readonly="readonly" type="text" value="${wbRepairUser.name!'无'}">
					</div>
					<div class="div-line-input">
						<label>联系方式：</label>
						<input readonly="readonly" type="text" value="${wbRepairUser.phone!'无'}">
					</div>
				</#if>
				<#if wbRepair.repairType=="3">
					<div class="div-line-input">
						<label>房间号：</label>
						<input readonly="readonly" type="text" value="${wxWbRoom.roomNum!'无'}">
					</div>
					<div class="div-line-input">
						<label>房间名称：</label>
						<input readonly="readonly" type="text" value="${wxWbRoom.roomName!'无'}">
					</div>
					<div class="div-line-input">
						<label>设备名称：</label>
						<input readonly="readonly" type="text" value="${wbRepair.deviceName}">
					</div>
					<div class="div-line-input">
						<label>报修人：</label>
						<input readonly="readonly" type="text" value="${wbRepairUser.name!'无'}">
					</div>
					<div class="div-line-input">
						<label>联系方式：</label>
						<input readonly="readonly" type="text" value="${wbRepairUser.phone!'无'}">
					</div>
				</#if>
				<div class="div-line-textarea border20">
					<label>故障描述：</label>
					<textarea readonly>${wbRepair.description}</textarea>
				</div>
				<!-- 图片上传 -->
				<div class="weui-cell border20 " style="padding:0.2rem 0.25rem;border-bottom:none;">
					<div class="weui-cell__bd">
						<div class="weui-uploader">
							<div class="weui-uploader__hd">
								<p class="weui-uploader__title">图片上传：</p>
							</div>
							<div class="weui-uploader__bd">
								<ul class="weui-uploader__files" id="showCLJG" data-objectId="">

								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="main-nei-block">
			<div class="main-nei-tit"><span>维修信息</span></div>
			<div class="service-records-list">
				<div class="div-line-input">
					<label>维修状态：</label>
					<input readonly="readonly" type="text" value="<#if wbRepair.status=='1'>待分配</#if><#if wbRepair.status=='2'>待维修</#if><#if wbRepair.status=='3'>返修</#if><#if wbRepair.status=='4'>待确认</#if><#if wbRepair.status=='5'>完成</#if>">
				</div>
				<div class="div-line-input">
					<label>维修人：</label>
					<input readonly="readonly" type="text" value="${wbRepair.repaimanName}">
				</div>
				<div class="div-line-input">
					<label>联系方式：</label>
					<input readonly="readonly" type="text"  value="${wbRepair.repaimanPhone}">
				</div>
			</div>
		</div>
		<div class="main-nei-block">
			<div class="main-nei-tit"><span>维修记录</span></div>
			<#if wbRepairRecordList?? && (wbRepairRecordList?size gt 0) >

			<#else>
			<div class="block-nodata">
				<span class="cyfont">&#xe869;</span>
				<h1>暂无维修记录</h1>
			</div>
			</#if>
			<div class="serviceRecord-ctn">
				<#if wbRepairRecordList?? && (wbRepairRecordList?size gt 0) >
					<#list wbRepairRecordList as wbRepairRecord>
						<div class="div-serviceRecord-line" onclick="showRecord(this)" data-status="${wbRepairRecord.status}" data-equipRecord="${wbRepairRecord.equipRecord}"  data-errorRecord="${wbRepairRecord.errorRecord}"  data-repairResult="${wbRepairRecord.repairResult}"  data-images="${wbRepairRecord.images}" data-repaimanName="${wbRepairRecord.repaimanName}" data-repaimanPhone="${wbRepairRecord.repaimanPhone}" >
							<div class="div-serviceRecord-txt ellipsis">${wbRepairRecord.repaimanName}进行了维修</div>
							<div class="div-serviceRecord-time">${wbRepairRecord.createTime?string('yyyy-MM-dd')}<i class="cyfont">&#xe60e;</i></div>
							<div class="div-circle"></div>
						</div>
					</#list>
				</#if>


				<!--<#if wbRepair.status=="2">
					<div class="div-serviceRecord-line" style="height:1.2rem;">
						<div id="add" class="div-serviceRecord-add menu-bg-color  open-popup" data-target="#full" ><i class="cyfont">&#xe6ab;</i>添加维修记录</div>
						<div class="div-bigcircle"></div>
					</div>

				</#if>-->
			</div>
		</div>

	</div>
</div>
<!--维修记录查看-->
<div id="recordShow" class='weui-popup__container'>
	<div class="popup-repair-tit wb-service-bg1">
		维修详情<div class="closebtn close-popup"><i class="cyfont">&#xe623;</i></div>
	</div>
<!--	<div class="closebtn close-popup" style="width:0.6rem;height:0.6rem;background:rgba(0,0,0,0.5);position:fixed;top:0;right:0;z-index:200;text-align:center;line-height:0.6rem;color:#fff;"><i class="cyfont">&#xe623;</i></div>-->
	<div class="weui-popup__overlay"></div>
	<div class="weui-popup__modal main-nei-ctn" style="width:100%;border-radius:0;padding:0;">
		<div class="main-nei-block" style="padding-bottom:0.54rem;border-radius:0;margin-bottom:0;padding-top:0;">
		<div class="service-records-list" style="margin-top:1rem; border-radius:0;">

			<div class="div-line-input">
				<label>维修人：</label>
				<input type="text" id="repaimanNameShow" readonly value=""/>
			</div>
			<div class="div-line-input">
				<label>联系电话：</label>
				<input type="text" id="repaimanPhoneShow" readonly value=""/>
			</div>
			<div class="div-line-input">
				<label>结果状态：</label>
				<input type="text" id="recordStatus" readonly value=""/>
			</div>
			<div class="div-line-textarea">
				<label>条件更换记录：</label>
				<textarea id="equipRecordShow" readonly placeholder="请输入条件更换记录"></textarea>
			</div>
			<div class="div-line-textarea border20">
				<label>故障报告：</label>
				<textarea id="errorRecordShow" readonly placeholder="请输入故障报告"></textarea>
			</div>
			<div class="div-line-textarea border20">
				<label>维修结果：</label>
				<textarea id="repairResultShow" readonly placeholder="请输入条件更换记录"></textarea>
			</div>

			<!-- 图片上传 -->
			<div class="weui-cell border20" style="padding:0.2rem 0.25rem;border-bottom:none;">
				<div class="weui-cell__bd">
					<div class="weui-uploader">
						<div class="weui-uploader__hd"><p class="weui-uploader__title">图片上传：</p></div>
						<div class="weui-uploader__bd">
							<ul class="weui-uploader__files" id="wxPicResultShow" data-objectId="">

							</ul>

						</div>
					</div>
				</div>
			</div>

		</div>
		</div>
	</div>
</div>

<#if wbRepair.status=='4'>
	<div class="tc" style="display: none;">
		<div class="eva-ctn">
			<div class="closebtn" onclick="hideBtn()"><i class="cyfont">&#xe6c5;</i></div>
			<div class="block-mid-tit">维修已完成</div>
			<div class="block-midsm-tit mart0">评价一下维修工程师吧</div>
			<div class="block-star-ctn">
				<div class="block-midsm-tit">评价工程师</div>
				<div class="fivestars" id="starid">
					<div class="item"><i class="cyfont">&#xe608;</i></div>
					<div class="item"><i class="cyfont">&#xe608;</i></div>
					<div class="item"><i class="cyfont">&#xe608;</i></div>
					<div class="item"><i class="cyfont">&#xe608;</i></div>
					<div class="item"><i class="cyfont">&#xe608;</i></div>
				</div>
			</div>
			<div class="block-mid-tit-line">
				<span>评价标签</span>
			</div>
			<div class="block-eva-lab">
				<span class="checked">效率高</span><span>服务态度好</span><span>不错</span><span>效率高</span><span>专业知识很全</span><span>速度快</span><span>准备很齐全</span>
			</div>
			<div  id="submit" class="block-botty-btn menu-bg-color">提交评价</div>
		</div>
	</div>
	<div class="bot-menu-xf-ctn wb-service-bg1">
		<div onclick="showBtn()"  class="bot-menu-xf">立即评价</div>
	</div>
</#if>
</body>

<script>
    cytShowPic('${wbRepair.images}','showCLJG');
    var token = '${token}';
    var applyId = '${applyId}';
    var repairId='${wbRepair.id}';
    var num=0;
    $("#starid .item").bind("click",function(){
        var index=$(this).index();
        $("#starid .item").each(function(n){
            num=n;
            if(n<index||n==index){
                $("#starid .item:eq("+n+")").addClass("checked");
            }
            else{
                $("#starid .item:eq("+n+")").removeClass("checked");
            }
        })
    })
    $(".block-eva-lab span").bind("click",function(){
        $(this).toggleClass("checked");
    })
    function showBtn() {
        $(".tc").show();
    }
    function hideBtn() {
        $(".tc").hide();
    }
    // 提交绑定
    $("#submit").on("click",function () {
        var pjTarget="";
        $(".block-eva-lab .checked").each(function(index,obj){
           if(pjTarget==null||pjTarget==""){
               pjTarget=$(obj).html();
		   }else{
               pjTarget=pjTarget+","+$(obj).html();
		   }
        })
        $.fn.doPost('/phone/wb/repairStatus',{repairId:repairId,status:"5",pjContent:"",pjScore:num,pjTarget:pjTarget}, function (result) {
            if (result.code == 0){
                $.alert("提交成功","报修提示",function () {
                    window.location.href = "/phone/wb/my?token="+token+"&applyId="+applyId;
                });
            }else {
                $.toast(result.msg,"text");
            }
        });
    });
    // 维修记录查看
    function showRecord(obj) {
        //维修结果:1、处理成功，2、返修
        var status=$(obj).attr("data-status");
        if(status=="1"){
            $("#recordStatus").val("处理成功");
        }else{
            $("#recordStatus").val("返修");
        }
        $("#repaimanNameShow").val($(obj).attr("data-repaimanName"));
        $("#repaimanPhoneShow").val($(obj).attr("data-repaimanPhone"));
        $("#equipRecordShow").html($(obj).attr("data-equipRecord"));
        $("#errorRecordShow").html($(obj).attr("data-errorRecord"));
        $("#repairResultShow").html($(obj).attr("data-repairResult"));
        var images=$(obj).attr("data-images");
        $("#wxPicResultShow").html("");
        if(images!=null&&images!=""){
            cytShowPic($(obj).attr("data-images"),'wxPicResultShow');
        }
        $("#recordShow").popup();
    }
</script>
</html>
